<%@ page import="java.sql.*,java.io.*,java.util.*"%>
<html>
<head><TITLE>Scalarsoft -ChipTrac</TITLE>
</head>
<%
	String hostFromRequest = request.getHeader("host");
	String srcPath = "";
	srcPath = "http://205.158.114.120:8080/cgi-bin/wcscgi.exe/chiptrac_scan/";
	String prompt0=request.getParameter("prompt0");
	if(prompt0==null)
	prompt0="";
	String prompt1=request.getParameter("prompt1");
	if(prompt1==null)
	prompt1="";
	String prompt2=request.getParameter("prompt2");
	if(prompt2==null)
	prompt2="";
	String prompt3=request.getParameter("prompt3");
	if(prompt3==null)
	prompt3="";
	String prompt4=request.getParameter("prompt4");
	if(prompt4==null)
	prompt4="";
	String prompt5=request.getParameter("prompt5");
	if(prompt5==null)
	prompt5="";
	String prompt6=request.getParameter("prompt6");
	if(prompt6==null)
	prompt6="";
	String prompt7=request.getParameter("prompt7");
	if(prompt7==null)
	prompt7="";
	String prompt8=request.getParameter("prompt8");
	if(prompt8==null)
	prompt8="";
	String prompt9=request.getParameter("prompt9");
	if(prompt9==null)
	prompt9="";
    String prompt10=request.getParameter("prompt10");
	if(prompt10==null)
    prompt10="";
    String prompt11=request.getParameter("prompt11");
	if(prompt11==null)
    prompt11="";


	/*String dbParameters="USER0=sa&PASSWORD0=ontrack20&DatabaseName=chiptrack.dsn&prompt0=";
	dbParameters += prompt0+"&prompt1="+prompt1+"&prompt2="+prompt2+"&prompt3="+prompt3;
	dbParameters += "&prompt4="+prompt4+"&prompt5="+prompt5+"&prompt6="+prompt6;
	dbParameters += "&prompt7="+prompt7+"&prompt8="+prompt8+"&prompt9="+prompt9;*/

        String dbParameters="USER0=sa&PASSWORD0=ontrack20&DatabaseName=chiptrac_scan.chiptrac_scan&prompt0=";
	dbParameters += prompt0+"&prompt1="+prompt1+"&prompt2="+prompt2+"&prompt3="+prompt3;
	dbParameters += "&prompt4="+prompt4+"&prompt5="+prompt5+"&prompt6="+prompt6;
	dbParameters += "&prompt7="+prompt7+"&prompt8="+prompt8+"&prompt9="+prompt9;
	dbParameters += "&prompt10="+prompt10;
	dbParameters += "&prompt11="+prompt11;
	String nameReport= "";
	String srcURL = "";

   nameReport= request.getParameter("nameReport");
   String subReport = request.getParameter("subReport");
   //System.out.println("subReport");
   String subReportParameters = "";
   if(subReport==null)
   subReport="";

   if(!subReport.equals(""))
   {
	subReportParameters="&USER0@"+subReport+"=sa&PASSWORD0@"+subReport+"=ontrack20";

   }
	//nameReport = "wip_new.rpt";

if (nameReport!=null && !nameReport.equals("")){

	srcURL = srcPath+nameReport+"?"+dbParameters+subReportParameters;
	//srcURL = srcPath+webapp+nameReport+"?"+dbParameters;
    //System.out.println("srcURL Latest "+srcURL);


}
%>
<frameset>
<frame marginwidth="0" marginheight="0" name="mainreceipt" src="<%=srcURL%>" scrolling="auto">
</frameset>
<body>
<OBJECT ID="CRViewer" CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A" WIDTH="100%" HEIGHT="95%"
    CODEBASE="/viewer/activeXViewer/ActiveXViewer.zip#Version=8,0,0,371">
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton" VALUE=0>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchExpertButton" VALUE=0>
<PARAM NAME="EnableSelectExpertButton" VALUE=0>
</OBJECT>
</body>
</html>